package com.zte.claa.inficombo.csa.app.service.gprscat1;

import org.apache.mina.core.future.WriteFuture;
import com.zte.claa.inficombo.csa.app.service.gprscat1.bean.GPRSDevCommand;
import com.zte.claa.inficombo.csa.app.service.gprscat1.bean.GPRSMessage;
import com.zte.claa.inficombo.csa.app.service.gprscat1.mina.GPRSDevConnSession;
import com.zte.claa.inficombo.csa.app.service.gprscat1.mina.GPRSDevServerManager;

public interface GPRSDevService {
	
	/**
	 * 接收底层消息上报
	 * 
	 * @param sessionId
	 * @param message
	 */
	public void onGPRSDevMsgReport(GPRSDevConnSession gprsconn, GPRSMessage message);
	
	/**
	 * 底层链路关闭通知.
	 * 
	 * @param sessionId
	 */
	public void onConnectionClose(long sessionId);
	
	/**
	 * 底层链路异常上报.
	 * 
	 * @param sessionId
	 * @param cause
	 */
	public void onExceptionReport(long sessionId, Throwable cause);
	
	/**
	 * 上层应用主动关闭某个传输装置的链路
	 * 
	 * @param transDevEui
	 * @throws Exception
	 */
	public void closeConnection(String deveui) throws Exception;
	
	/**
	 * 上层应用主动下发命令
	 * 
	 * @param transDevEui
	 * @throws Exception
	 */
	public WriteFuture sendCommand(String deveui, GPRSDevCommand cmd) throws Exception;
	
	public GPRSDevServerManager getConnSvrManager();
	
}
